1. Field of the Invention
The present invention relates to a texture pattern memory circuit for use in texture mapping.
2. Description of the Related Art
Texture mapping is used as one of typical methods of creating richness of texture in three-dimensional computer graphics. Texture mapping is a technique which represents texture of an article by applying (or mapping) a separately defined texture pattern such as a grainy pattern or marble pattern onto a surface of a three-dimensional shape in order to create richness of texture of the article.
There are several techniques to map a two-dimensional image on a three-dimensional shape. One of the techniques is a `UV mapping`. Referring now to FIG. 1, an example of the UV mapping will be described.
First, suppose that a figure surface onto which a pattern is mapped is represented by a coordinate system specified by U and V (to be referred to hereinafter as UV-coordinate system). It is also assumed that two-dimensional coordinate systems for a texture pattern and a display are designated by ST- and XY-coordinate systems respectively.
The color and brightness of a point (U,V) on the 3-dimensional figure surface displayed on the display coordinate system (X,Y) is determined by effecting calculative (filtering) operation as to the color and brightness at a corresponding point (S,T) and in its peripheral area on the texture pattern coordinate system. When the geometric feature of a figure to be mapped is not very complicated, the relationship between (U,V) and (S,T) is determined by specifying the positions of apexes of polygons with proper U-, V-values or S-, T-values and calculating the inside values of the polygons using linear interpolation. At the time of the texture mapping, the transformation of the coordinate systems is performed in the order of (X,Y).fwdarw.(U,V).fwdarw.(S,T).
Examples of texture patterns include photographs and pictures inputted using an image scanner as well as those patterns generated by programs.
In practice, as shown in FIG. 2, a texture pattern memory 51 that stores a texture pattern determined by the aforementioned method is mapped onto a frame memory 53 that stores data to be displayed on a display, by filtering the texture pattern to produce a drawing pattern in the form of a vector drawing onto the frame memory 53. The drawing onto the frame memory 53 is performed based on the XY-coordinate system and data is read from the texture pattern memory 51 by calculating the ST-coordinate system using linear interpolation.
Specifically, a drawing controller 54 instructs the texture pattern memory 51 to read out information at a memory location specified by coordinates (S,T) and instructs the frame memory 53 to write the information into a memory location specified by coordinates (X,Y). In response to the instructions, the color and brightness at the coordinate point (S,T) and in its peripheral area is read out and filtered through a writing data calculating unit 52. The filtered result is written onto the frame memory 53. The content in the frame memory 53 is displayed on a display 55.
In the filtering process, the data from the texture pattern memory is shaped so that the texture to be displayed on the display may appear as a continuous texture pattern. If color or brightness is determined merely based on the data at individual coordinate points (S,T) without effecting the filtering process, the resultant picture applied in the form of a 3-dimensional figure turns out to be a sporadic or jagged image.
There are several schemes for such filtering. A typical method is that the average values of the color and brightness around a coordinate point (S,T) are used for displaying. Consider this method with reference to FIG. 3. Hereinbelow, it is assumed that a pixel represents a single dot in a display pattern stored in the frame memory and a texel represents a single dot in a texture pattern stored in the texture pattern memory.
As shown in FIG. 3, the color or brightness to be applied to a pixel should be represented by the average value of color or brightness of the hatching centered by the coordinate point (S,T). The size of the hatching is a projected size of an XY-coordinate pixel on the texture pattern and is determined by the transformation of (X,Y).fwdarw.(U,V).fwdarw.(S,T). Therefore, the size may differ depending on the tilt or size of the surface of the 3-dimensional figure to which the pixel is applied. The coordinate point (S,T) is not necessarily positioned at the center of a pixel. It is hardly possible for the coordinates which are determined by the transformation, to be integer values.
The writing data calculating unit 52 of a simple kind selects four texels near a point (S,T) shown in the figure and divides the sum of the brightness values by four to produce an output. In a practical circuit, it is hardly possible to select the nearest four texels to the point (S,T) in response to the readout instructions of the coordinate point (S,T). Therefore, texel data on all the nine texels shown, or all the texel data around the integer pair (S,T) which is produced by rounding the original (S,T) to integer values is adapted to be outputted to the writing data calculating unit 52. In the following description, (S,T) will always designate the integer pair thus rounded to integers.
Examples of the methods of reading out a plurality of texel data from the texture pattern memory are as follows:
(1) Multi-Accessing Scheme
FIG. 4 is a block diagram showing a texture pattern memory for effecting the method. In this circuit, a counter 56 counts the clock signal. An offset output circuit 57 outputs offset data by sequentially changing its value with reference to the counting value from the counter 56. The offset data outputted is added to the coordinates (S,T) in an adder 58 and the resultant is outputted to an address converting device 59. The address converting device 59 calculates addresses to be accessed in a texture pattern memory 60. In this way, the designated address is successively varied so as to enable a multiple number of accesses in the texture pattern memory 60 to load a plurality of texel data from the memory.
This method, however, must effect a great number of accesses to the memory, thus needing a longer time. For example, in order to obtain nine texel data, nine accesses to the memory are required.
(2) Multi-Memory Scheme
FIG. 5 is a block diagram showing a texture pattern memory for effecting the method. As shown in the figure, this method requires a plurality of texture pattern memories in which an identical texture pattern is stored in properly shifted memory locations as to the (S,T) system. By this configuration, designation of a single address allows a plurality of accesses to the texture pattern memory modules, whereby texel data at the multiple number of coordinate points can be obtained at the same time.
This technique, however, has to store a plural number of texture patterns having the same content and requires bulky memory, resulting in increased cost. For example, in order to obtain nine texel data, nine memory devices are needed.
(3) Multi-Accessing and Multi-Memory Scheme
FIG. 6 is a block diagram showing a texture pattern memory for effecting the method. This technique is a combination of the configurations shown in FIGS. 4 and 5 and the blocks designated by the same reference numerals have the same functions. This configuration makes it possible to reduce the number of times of accesses to the memory as well as the size of memory. For example, to obtain nine texel data requires three memory modules and three accesses to the memory.
This technique, however, merely offers intermediate effects between the multi-accessing technique and the multi-memory technique. That is, the number of memory modules required is increased as compared to the multi-accessing technique whereas the number of times of accesses to the memory is increased as compared to the multi-memory technique.